<template>
  <view>
    <u-navbar title="慢病宣教" back-icon-size="34" title-size="36" :border-bottom="false" :background="background" title-color="#222" back-icon-color="#222"></u-navbar>
    <view
      class=""
      style="margin: 20rpx 28rpx; background: #fff; border-radius: 20rpx; display: flex; align-items: center; justify-content: space-between; padding: 31rpx 40rpx"
      @tap="text(i.id)"
      v-for="(i, k) in list"
      :key="k"
    >
      <view class="" style="font-size: 28rpx">
        {{ i.title }}
      </view>
      <image :src="img_url + i.image" mode="aspectFill" style="height: 158rpx; border-radius: 20rpx; width: 226rpx"></image>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      background: {
        background: '#FFFFFF'
      },
      page: 1,
      list: []
    };
  },
  methods: {
    text(e) {
      uni.navigateTo({
        url: '/home/text/text?id=' + e
      });
    },
    proclaim() {
      this.api({
        url: '/api/healthy/getKnowledgeList',
        method: 'post',
        data: {
          page: this.page
        }
      }).then((res) => {
        this.list = this.list.concat(res.data);
        this.page++;
      });
    }
  },
  onShow() {
    this.proclaim();
  }
};
</script>

<style>
page {
  background: #f8f8f8;
}
</style>
